<?php

namespace app\admin\validate;

use think\Validate;

class User extends Validate {

    /**
     * 规则定义
     * @var array
     */
    protected $rule = [
        'username'  => 'require|min:1|max:18',
        'password'  => 'require|min:6|max:32',
        'captcha'   => 'require|length:4'
    ];

    /**
     * 提示信息定义
     * @var array
     */
    protected $message = [
        'username'  => '请输入1-18位用户名',
        'password'  => '请输入6-32位密码',
        'captcha'   => '请输入4位图像验证码'
    ];

    /**
     * 场景定义
     * @var array
     */
    public $scene = [
        'doLogin'      => ['username', 'password', 'captcha'],
    ];
}